import os
import sys
import re

if __name__ == '__main__':
    handler = sys.stdin
    for line in handler:
        if not line:
            continue
	#require all datas
	#delete all blanks
        friend = line.strip().split(" ")
	#require all first people
	owner=friend[0]
	#require your own friends
	owner_friends=friend[1:]
	#input friend1 friend2 +people
        for i in range(0,len(owner_friends)):
            for j in range(i+1,len(owner_friends)):
		print(owner_friends[i]+owner_friends[j]+' '+owner)
